1888/dense linop - #2042
Conversation
73996c7 to
1e611b2
Compare
fbd5d57 to
59a1fa6
Compare
27a7815 to
65e737c
Compare
59a1fa6 to
7e96d52
Compare
04359e0 to
aa6583d
Compare
6c1727e to
8728fb4
Compare
aa6583d to
17b8605
Compare
bd7e3ef to
8a641ad
Compare
17b8605 to
230bb98
Compare
8a641ad to
8f00cd9
Compare
17b8605 to
da076d1
Compare
8f00cd9 to
e73b43c
Compare
da076d1 to
e5527df
Compare
| } | ||
|
|
||
| const LinOp* beta, | ||
| LinOp* x) const GKO_NOT_IMPLEMENTED; |
There was a problem hiding this comment.
because here is marked not implemented. the corresponding kernel and common hook can also be removed
There was a problem hiding this comment.
The corresponding kernel is used in matrix::Dense.
e5527df to
b930916
Compare
yhmtsai
left a comment
There was a problem hiding this comment.
submit the partial review. Github seems to bring some changes in rename-dense here currently
| if (dynamic_cast<const Diagonal<ValueType>*>(b)) { | ||
| exec->run(multivector::make_add_scaled_diag( | ||
| make_temporary_conversion<ValueType>(alpha) | ||
| ->get_const_device_view(), | ||
| dynamic_cast<const Diagonal<ValueType>*>(b), | ||
| this->get_device_view())); | ||
| } else { |
There was a problem hiding this comment.
I'm not sure how much this is needed for the vectors. It is already available for dense so it can be done via vec->as_dense_view()->add_scaled(diag). But I can also add it here (or move it from dense to here).
| * @param exec executor where the matrix should be allocated | ||
| * @param args additional arguments for the matrix constructor | ||
| * | ||
| * @return the unique pointer of gko::matrix::MultiVector<ValueType> |
There was a problem hiding this comment.
| * @return the unique pointer of gko::matrix::MultiVector<ValueType> | |
| * @return the unique pointer of gko::matrix::Dense<ValueType> |
| if ((mode & permute_mode::rows) == permute_mode::rows) { | ||
| // compute P * A | ||
| permutation_csr->apply(input, result); | ||
| result = permutation_csr->multiply(input); |
There was a problem hiding this comment.
What are you asking here?
| { | ||
| csr1 = Csr::create(exec); | ||
| csr1->copy_from(dense1); | ||
| csr1->copy_from(dense1->as_const_dense_view().get()); |
There was a problem hiding this comment.
should these be created as dense not multivector?
There was a problem hiding this comment.
No, they are used as vectors everywhere but here.
| auto mtx = gko::share(MultiVector::create_with_config_of( | ||
| this->l_dense->as_multivector_view())); | ||
| this->l_dense->apply(this->u_dense->as_const_multivector_view(), mtx); | ||
| auto ilu_factory = | ||
| gko::preconditioner::Ilu<value_type, false, index_type>::build() | ||
| .with_l_solver(LowerIsai::build()) | ||
| .with_u_solver(UpperIsai::build()) | ||
| .on(this->exec); | ||
| auto ilu = ilu_factory->generate(mtx); | ||
| auto ilu = ilu_factory->generate(mtx->as_const_dense_view()); |
There was a problem hiding this comment.
this is how user will use dense/multivector.
There was a problem hiding this comment.
I think here it could also be done with storing one multivector and one dense object, but I think I was lazy.
| auto permuted = gko::as<typename TestFixture::Mtx>( | ||
| this->star_mtx->permute(&perm_array)); | ||
| auto permuted = this->star_mtx->as_multivector_view() | ||
| ->permute(&perm_array) | ||
| ->as_dense_view() | ||
| ->clone(); |
There was a problem hiding this comment.
I think the clone is necessary to keep the return value of permute alive.
| using initial_guess_mode = gko::solver::initial_guess_mode; | ||
| auto ref_solver = | ||
| auto ref_factory = | ||
| gko::solver::Ir<value_type>::build() | ||
| .with_criteria(gko::stop::Iteration::build().with_max_iters(1u)) | ||
| .on(this->exec) | ||
| ->generate(this->mtx); | ||
| .on(this->exec); |
There was a problem hiding this comment.
any reason not to generate ref_solver here?
There was a problem hiding this comment.
don't remember. Seems to work without it, so I will revert it
ea2b468 to
01e46b2
Compare
This reverts commit b930916.
01e46b2 to
9ef2419
Compare
b930916 to
17b823e
Compare
Signed-off-by: Marcel Koch <marcel.koch@kit.edu>
Signed-off-by: Marcel Koch <marcel.koch@kit.edu>
- diagonal extractable - scaled identity addable - add/sub scaled diagonal
9ef2419 to
00348a0
Compare
This PR adds a Dense matrix format.